export default {
    login(state,data){
        if(!data){
            return state.set("uid",+sessionStorage.getItem("uid")).set("token",sessionStorage.getItem("token"))
        }else{
            this.setStorage(data)
            return state.set("uid",data.uid).set("token",data.token)
        }
    },
    setStorage(data){
        sessionStorage.setItem("uid",data.uid)
        sessionStorage.setItem("token",data.token)
    },
    setUrl(state,data){
        return state.set("url",data)
    }
}